Skip to content

Partial fix for nested procedural filters in :has() selectors#589

Open
fresh3nough wants to merge 1 commit intobrave:masterfrom
fresh3nough:cody/fix/nested-procedural
Open

Partial fix for nested procedural filters in :has() selectors#589
fresh3nough wants to merge 1 commit intobrave:masterfrom
fresh3nough:cody/fix/nested-procedural

Conversation

@fresh3nough
Copy link

This commit improves support for nested procedural operators within :has() selectors, addressing issue #495.

Changes:

  • Modified has_procedural_operator() to recursively check for procedural operators inside :has() arguments
  • Added logic to extract procedural operators like :has-text() when nested within :has() selectors
  • Improves parsing for filters like: ytd-rich-item-renderer:has(.style-scope:has-text(Members only))

Limitations:

  • Selectors with combinators inside :has() (e.g., :has(> span:has-text(...))) are not fully supported yet due to complexity in reconstruction
  • The extracted selector structure may not be optimal in all cases

Fixes #495 (partial)

This commit improves support for nested procedural operators within
:has() selectors, addressing issue brave#495.

Changes:
- Modified has_procedural_operator() to recursively check for procedural
  operators inside :has() arguments
- Added logic to extract procedural operators like :has-text() when
  nested within :has() selectors
- Improves parsing for filters like:
  ytd-rich-item-renderer:has(.style-scope:has-text(Members only))

Limitations:
- Selectors with combinators inside :has() (e.g., :has(> span:has-text(...)))
  are not fully supported yet due to complexity in reconstruction
- The extracted selector structure may not be optimal in all cases

Fixes brave#495 (partial)
@fresh3nough fresh3nough requested a review from a team as a code owner January 18, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested procedural filter not working

1 participant